Blockly.Blocks['pig1'] = {
    init: function() {
      this.appendDummyInput()
          .appendField(new Blockly.FieldImage("../res1/1.jpg", 400, 75, "*"));
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(230);
   this.setTooltip("");
   this.setHelpUrl("");
    }
  };

  Blockly.Blocks['pig2'] = {
    init: function() {
      this.appendDummyInput()
          .appendField(new Blockly.FieldImage("../res1/2.jpg", 400, 75, "*"));
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(230);
   this.setTooltip("");
   this.setHelpUrl("");
    }
  };

  Blockly.Blocks['pig3'] = {
    init: function() {
      this.appendDummyInput()
          .appendField(new Blockly.FieldImage("../res1/3.jpg", 400, 75,"*"));
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(230);
   this.setTooltip("");
   this.setHelpUrl("");
    }
  };

  Blockly.JavaScript['pig1'] = function(block) {
    // TODO: Assemble JavaScript into code variable.
    var code = "#pig1";
    return code;
  };

  Blockly.JavaScript['pig2'] = function(block) {
    // TODO: Assemble JavaScript into code variable.
    var code = '#pig2';
    return code;
  };

  Blockly.JavaScript['pig3'] = function(block) {
    // TODO: Assemble JavaScript into code variable.
    var code = '#pig3';
    return code;
  };